#include "clase.h"
extern int MAX;
numarComplex::numarComplex()
{
    real=0.0;
    imag=0.0;
}

numarComplex::numarComplex(double x, double y)
{
    real=x;
    imag=y;
}

numarComplex::~numarComplex()
{
}

double numarComplex::getReal()
{
    return this->real;
}

double numarComplex::getImag()
{
    return this->imag;
}

void numarComplex::setReal(double x)
{
    this->real=x;
}

void numarComplex::setImag(double y)
{
    this->imag=y;
}
numarComplex numarComplex::operator+(numarComplex x)
{
    double re,im;
    re=this->real + x.getReal();
    im=this->real + x.getImag();
    numarComplex d(re,im);
    return d;
}

numarComplex numarComplex::operator+(double x)
{
    double re,im;
    re=this->real + x;
    im=this->imag;
    numarComplex d(re,im);
    return d;
}
ostream& operator<<(ostream& out,numarComplex x)
{
    out<<"real="<<x.real<<' ';
    out<<"imag="<<x.imag<<endl;
    
}
ostream& operator<<(ostream& out,numarComplex x[])
{
    numarComplex *pt;
    pt=x;
    for (int i=0;i<3;i++){
    out<<"real="<<x->real<<' ';
    out<<"imag="<<x->imag<<endl;
    }
}